class PingAllComputers < ActiveRecord::Base

  computers = Computer.all

  for computer in computers
    if (computer.status != 2)
      if (ComputersHelper::pingecho(computer.ip_address))
        computer.status = 1
      else
        computer.status = 0
      end
      computer.save
    end
  end

end